﻿using System;
using System.ComponentModel.Composition.Hosting;
using System.ServiceModel;
using Cubicle.Core.Config;

namespace Cubicle.Core.Interfaces
{

    public interface IProcessor
    {
        event EventHandler ProcessorEvent;
        IProcessor Parent { get; set; }
        ProcessorConfig Config { get; set; }
        void RaiseProcessorEvent(object sender, EventArgs e);        
    }

    [ServiceContract(
        SessionMode = SessionMode.Allowed,
        Namespace = "http://www.cubicle.co.uk/",
        Name = "IProcessor")]
    public interface IProcessor<T> : IProcessor
    {
        [OperationContract]
        T Process(T input);
    }

    public interface IProcessorQueue : IProcessor
    {
        void AddProcessor(CompositionContainer container, ProcessorConfig config);
    }

}